package com.zy.algorithm.controller;

import android.animation.AnimatorListenerAdapter;
import android.view.View;
import android.view.ViewGroup;

import com.zy.algorithm.R;
import com.zy.view.SubSetTipsView;

import java.util.List;

//分组动画控制器
public class SubSetController {

    private final ViewGroup container;
    private final SubSetTipsView subSetTipsView;

    public SubSetController(View root) {
        container = root.findViewById(R.id.sub_set_container);
        subSetTipsView = root.findViewById(R.id.sub_set);
    }

    public void show(){
        container.setVisibility(View.VISIBLE);
    }

    public void showSubSet(List<SubSetTipsView.SubSetNode> nodeList, AnimatorListenerAdapter animatorListenerAdapter){
        subSetTipsView.clear();
        subSetTipsView.addNodeList(nodeList);
        subSetTipsView.startAnimator(animatorListenerAdapter);
    }


}
